package com.hryt.firstandroid;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;

public class SingleTopActivity extends AppCompatActivity {

    private static final String TAG = "====Single====";

    private Button mBtnStartSelf;
    private Button mBtnStartMain;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_top);

        mBtnStartSelf = findViewById(R.id.btn_start_self);
        mBtnStartSelf.setOnClickListener(view -> {
            Intent intent = new Intent(SingleTopActivity.this, SingleTopActivity.class);
            startActivity(intent);
        });

        mBtnStartMain = findViewById(R.id.btn_start_main);
        mBtnStartMain.setOnClickListener(view -> {
            Intent intent = new Intent(SingleTopActivity.this, MainActivity.class);
            startActivity(intent);
        });
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Log.d(TAG, "onNewIntent");
    }
}